/*
 * Chocolate Tunnel v0.6 Beta
 */
package Chocolate;

import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Achmat Toffa
 * @email: Achmat.Toffa@gmail.com
 * 
 */
public class About extends javax.swing.JFrame {
    static int x ,y; //x and y co-ordinates

    /**
     * Creates new form About
     */
    public About() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        mainPanel1 = new javax.swing.JPanel();
        aboutMenuPanel = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextArea1 = new javax.swing.JTextArea();
        jLSkullRed2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("About");
        setMinimumSize(new java.awt.Dimension(300, 350));
        setName("about"); // NOI18N
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
            public void windowClosed(java.awt.event.WindowEvent evt) {
                formWindowClosed(evt);
            }
        });
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentMoved(java.awt.event.ComponentEvent evt) {
                formComponentMoved(evt);
            }
        });

        mainPanel1.setMaximumSize(new java.awt.Dimension(300, 350));
        mainPanel1.setLayout(new java.awt.GridBagLayout());

        aboutMenuPanel.setFocusable(false);
        aboutMenuPanel.setMaximumSize(new java.awt.Dimension(300, 350));
        aboutMenuPanel.setMinimumSize(new java.awt.Dimension(300, 350));
        aboutMenuPanel.setOpaque(false);

        jbAboutBack.setBackground(new java.awt.Color(44, 44, 44));
        jbAboutBack.setForeground(new java.awt.Color(254, 254, 254));
        jbAboutBack.setText("Back");
        jbAboutBack.setToolTipText("Back to Main");
        jbAboutBack.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR));
        jbAboutBack.setFocusPainted(false);
        jbAboutBack.setFocusable(false);
        jbAboutBack.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                jbAboutBackMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                jbAboutBackMouseExited(evt);
            }
        });
        jbAboutBack.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbAboutBackActionPerformed(evt);
            }
        });

        jScrollPane1.setBackground(new java.awt.Color(255, 255, 255));
        jScrollPane1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(44, 44, 50), 5));
        jScrollPane1.setForeground(new java.awt.Color(255, 255, 255));
        jScrollPane1.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
        jScrollPane1.setAutoscrolls(true);
        jScrollPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jScrollPane1.setFocusable(false);

        jTextArea1.setEditable(false);
        jTextArea1.setBackground(new java.awt.Color(44, 44, 44));
        jTextArea1.setColumns(20);
        jTextArea1.setFont(new java.awt.Font("Monospaced", 0, 14)); // NOI18N
        jTextArea1.setForeground(new java.awt.Color(255, 255, 255));
        jTextArea1.setLineWrap(true);
        jTextArea1.setRows(27);
        jTextArea1.setText("Chocolate Version 0.6 Beta\nAuthor: Achmat Toffa\nIndia Web Proxy Version 1.0\nAuthor: Arunava Bhowmick\nBuild Date: 08 July 2013\n\nChocolate is a tool that tunnels data on port 80 and port 443. It allows the user to connect to a php script on a specified I.P. address which would act as a web proxy whilst modifying certain headers that are sent out and recieved to bypass network restrictions.\n  \nThis program is to be used for educational purposes only!\n\nI hereby state that I take no responsibilty for any abuse or missuse caused by this program and the users thereof. This abuse may includes, and is not limited to: Information theft and/or any kind of network abuse.\n\nUse chocolate at your own risk!\n\nFor weekly free servers and tweaks, follow me on twitter http://twitter.com/achmattoffa");
        jTextArea1.setWrapStyleWord(true);
        jTextArea1.setMaximumSize(new java.awt.Dimension(280, 295));
        jTextArea1.setMinimumSize(new java.awt.Dimension(280, 295));
        jTextArea1.setName(""); // NOI18N
        jTextArea1.setRequestFocusEnabled(false);
        jScrollPane1.setViewportView(jTextArea1);

        javax.swing.GroupLayout aboutMenuPanelLayout = new javax.swing.GroupLayout(aboutMenuPanel);
        aboutMenuPanel.setLayout(aboutMenuPanelLayout);
        aboutMenuPanelLayout.setHorizontalGroup(
            aboutMenuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(aboutMenuPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(aboutMenuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
                    .addGroup(aboutMenuPanelLayout.createSequentialGroup()
                        .addComponent(jbAboutBack, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        aboutMenuPanelLayout.setVerticalGroup(
            aboutMenuPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, aboutMenuPanelLayout.createSequentialGroup()
                .addGap(16, 16, 16)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jbAboutBack)
                .addContainerGap())
        );

        mainPanel1.add(aboutMenuPanel, new java.awt.GridBagConstraints());

        jLSkullRed2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Chocolate/skullRed.jpg"))); // NOI18N
        jLSkullRed2.setFocusable(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        mainPanel1.add(jLSkullRed2, gridBagConstraints);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(mainPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE)))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 350, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(mainPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 0, Short.MAX_VALUE)))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbAboutBackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbAboutBackActionPerformed
        this.dispose();
    }//GEN-LAST:event_jbAboutBackActionPerformed

    private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
        MainUI.jbFormVisible.doClick();
    }//GEN-LAST:event_formWindowClosed

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
        setLocation(MainUI.x, MainUI.y);
        jTextArea1.select(0, 0);
    }//GEN-LAST:event_formWindowOpened

    private void formComponentMoved(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_formComponentMoved
        x = getX();
        y = getY();
    }//GEN-LAST:event_formComponentMoved

    private void jbAboutBackMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbAboutBackMouseEntered
        MainUI.colourLooper = 1;
        MainUI.whichButton = jbAboutBack.getText();
        (new MainUI.Looper()).start();
    }//GEN-LAST:event_jbAboutBackMouseEntered

    private void jbAboutBackMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jbAboutBackMouseExited
        MainUI.colourLooper = 2;
        try {
            Thread.sleep(10);
            jbAboutBack.setBackground(new java.awt.Color(44,44,44));
        } 
        catch (InterruptedException ex) {
            Logger.getLogger(Settings.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jbAboutBackMouseExited

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(About.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(About.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(About.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(About.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new About().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public static javax.swing.JPanel aboutMenuPanel;
    public static javax.swing.JLabel jLSkullRed2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jTextArea1;
    public static final javax.swing.JButton jbAboutBack = new javax.swing.JButton();
    public static javax.swing.JPanel mainPanel1;
    // End of variables declaration//GEN-END:variables
}
